import java.util.Arrays;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2023-10-14
 * Time：19:50
 */
public class TestDemo {
    /**
     * 遍历二维数组
     * @param args
     */
    public static void main(String[] args) {
        int[][] arr = {{1,2,3},{4,5,6},{7,8,9}};
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                System.out.print(arr[i][j] + " ");
            }
            System.out.println();
        }
        System.out.println("===============");
        for(int[] tmp : arr) {
            for(int x : tmp) {
                System.out.print(x + " ");
            }
            System.out.println();
        }
        System.out.println("===============");
        System.out.println(Arrays.deepToString(arr));
    }
    public static void main2(String[] args) {
        int[][] arr = {{1,2,3},{4,5,6},{7,8,9}};
        int[][] arr2 = new int[][]{{1,2,3},{4,5,6},{7,8,9}};
        int[][] arr3 = new int[3][3];
    }
    public static void main1(String[] args) {
        int[] array = {1,2,3,4,5};
        //from ... to ... ->[1,3)
        int[] copy = Arrays.copyOfRange(array, 1, 3);
        System.out.println(Arrays.toString(copy));
    }
}
